package com.young.springdemo.service.expression;
//方向节点
public class DirectionNode extends AbstractExpression {
    private String direction; //up,down,left,right

    public DirectionNode(String direction) {
        this.direction = direction;
    }

    @Override
    public String interrupt() {
        if (direction.equalsIgnoreCase("up")){
             return "向上 ";
        }else if (direction.equalsIgnoreCase("down")){
            return "向下 ";
        }else if (direction.equalsIgnoreCase("left")){
            return "向左 ";
        }else if (direction.equalsIgnoreCase("right")){
            return "向右 ";
        }else {
           return "指令不符";
        }
    }
}
